var now = getNowFormatDateTime(); 
var username = sessionStorage.getItem("name");
var userid = sessionStorage.getItem("userId");
var searchtype ="";
var trStr;
$(document).ready(function(){
	getData();
	$('#searchButton').on('click',function(){
		if($('#shopcode').val()== "" || $('#shopcode').val()==undefined){
			alert("名称不能为空")
		}else{
			$("#data").text('');
			getData();
		}
	});
});
function getData(){
	$.ajax({
		url: '../../repair_info/getequip'
		,type:'post'
		,dataType:'json'
		,contentType: "application/json; charset=utf-8"
		,data:JSON.stringify({'shopcode':$('#shopcode').val(),"searchtable":searchtype})  
		,success: function(res){
			for (var i = 0; i < res.data.length; i++) {
					console.log(i);
					console.log(res.data[i].name);
					trStr = '<div style="text-align:center;margin-top:10px" id="'+res.data[i].id+'" >'+res.data[i].name+'</div>';
					$('#menu').append(trStr);
			}
			
		//	trStr ="";
		}
	});
}
function detail(id){	
	var url  = "../../mobile_page/baoxiu/baoxiu_weixiu_search?id="+id;//此处拼接内容
	window.location.href = url;
}	